#ifndef __DRIVER_H
#define __DRIVER_H

#include <vfs/dir.h>


//#define DRIVER_NAME(name)
#define DRIVER_AUTHOR(author)
#define DRIVER_DESC(desc)
#define DRIVER_METHODS(methods)
#define DRIVER_PROBE(probe)
#define DRIVER_INIT(init)
#define DRIVER_FREE(free)	
	
#define DRIVER_DEPEND(drivers) \
	char d_depends[][32] = { drivers };
	 
	 
/* type of driver */
typedef enum DRV_TYPE { BLOCK, CHAR, SYSTEM, FS, NET } DRV_TYPE;
	 
	 
/* inside each driver, there different type of probing */

/* freebsd support? maybe */
typedef int (*d_open_t)(void *, int, int, void *);
typedef uint32_t d_close_t;
typedef uint32_t d_read_t;
typedef uint32_t d_write_t;


typedef struct
{
	d_open_t open;
	d_close_t close;
	d_read_t read;
	d_write_t write;
} drv_methods_t;

/* driver */
typedef struct drv_p
{
	char name[32];
	char author[32];
	char desc[32];

	uint32_t (*probe)();
	uint32_t (*init)();
	uint32_t (*free)();
	
	drv_methods_t methods;
	
	struct drv_p *next;
} drv_t;


drv_t *drvlist;

int drv_init();
drv_t *drv_iget(int i);

#endif
